package cate.common.table.res.sign.item;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("每日签到 奖励配置Row")
public class DailySignItemRow extends ERow {
    @NoteField("Excel配置ID")
    public int excelId;
    @NoteField("分组")
    public int group;
    @NoteField("签到天数")
    public int day;
    @NoteField("签到奖励")
    public String rewardStr;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        excelId = xrw.getInteger("ID");
        group = xrw.getInteger("分组");
        day = xrw.getInteger("签到天数");
        rewardStr = xrw.getString("签到奖励");
        id = generateId(group, day);
    }

    /**
     * 根据奖励分组和天数生成唯一ID
     *
     * @param group 奖励分组
     * @param day 天数
     * @return 唯一ID
     */
    public static int generateId(int group, int day) {
        return group * 1000 + day;
    }
}
